
public class Main {
    public static void main(String[] args) {
        int[] unm ={1,2,3,4,5,6};
        int n=3,l=1;
        func(unm,0, unm.length-n-1,n);
        func(unm,0,unm.length-1, unm.length);
    }
    public static void func(int[] unm,int r,int l,int le){
        int len=le/2;
        while (len!=0){
       int tmp=unm[r];
       unm[r]=unm[l];
       unm[l]=tmp;
       r++;
       l--;
       len--;
        }
        for (int i = 0; i < 6; i++) {
            System.out.printf("%d ",unm[i]);
        }
        System.out.println( );
    }
    }